<?php
//面向对象，累和对象
//声明一个类型，类似车的磨具
class Car{
	public $carMode;//存放车的型号
	public $carBand;//存放车的品牌
	public $weight;//车的重量
	public $speed;//车的速度

	function getWeight(){
		return $this->weight;
	}
	function getSpeed(){
		return $this->speed;
	}
}

// 使用类来创建新的对象，实例化
$car1 = new Car();
$car1->carMode = "捷达";
$car1->carBand = "大众";
$car1->weight = 1.5;
$car1->speed = 160;
echo $car1->weight;
echo "<br/>";
echo $car1->getWeight();
echo "<br/>";
echo $car1->getSpeed();